﻿@using KimPhongCRM.Models
@model tblKhachHang
@{
    Layout = "~/Views/Shared/_PartialLayout.cshtml";
    ViewBag.Title = "Details";
}

<div class="row-fluid bg-white">
    <table class="table table-bordered">
        <thead>
            <tr>
                <th>Họ và tên</th>
                <th>@Model.hoKH @Model.tenKH</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td width:30>Ngày sinh</td>
                <td class="center">@Model.sinhNhatKH.ToShortDateString()</td>
            </tr>

            <tr>
                <td width:30>Địa chỉ</td>
                <td class="center">@Model.diaChiKH</td>
            </tr>

            <tr>
                <td>Điện thoại</td>
                <td class="center">@Model.sdtKH</td>
            </tr>

            <tr>
                @{
                    tblLoaiThe loaithe = new tblLoaiThe();
                    try
                    {
                        Entities Entities = new Entities();
                        loaithe = Entities.tblLoaiThes.Find((long)Model.tblTheVips.First().maThe);
                    }
                    catch { };
                  }
                <td>Thẻ</td>
                <td class="center">
                        @Html.Raw("<span style=\"padding:2px 20px;margin-right:5px;background:"+loaithe.mauThe+"\"></span><span>" + loaithe.tenThe + "</span>")
                </td>
            </tr>

            <tr>
                <td>Ngày khởi tạo</td>
                <td class="center">@Model.ngayNhap.ToShortDateString()</td>
            </tr>
        </tbody>
    </table>
    <p style="text-align: center;"><a id="popUpdateContent" target="_blank" href="@Url.Action("Edit", "KhachHang", new {id=Model.maKH })" class="btn btn-large btn-info">Cập nhật thông tin</a></p>
</div>
<script>
    $(document).ready(function () {
        $('#popUpdateContent').live('click', function (event) {
            event.preventDefault();
            window.open($(this).attr('href'));
        });
    });
</script>
